package com.glsc.ngateway.common.base.domain.mysql.gateway.platform.it.networkassets;

import com.glsc.ngateway.common.base.domain.mysql.BaseEntity;
import lombok.*;
import lombok.experimental.SuperBuilder;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.SQLDeleteAll;
import org.hibernate.annotations.Where;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Index;
import javax.persistence.Table;
import java.io.Serializable;

/**
 * 速率异常排除
 * @author xuchang
 */
@EqualsAndHashCode(callSuper = true)
@Data
@NoArgsConstructor
@AllArgsConstructor
@SuperBuilder
@Entity
@Where(clause = "deleted = 0")
@SQLDelete(sql = "update t_gw_it_net_assets_rate_exception set deleted = UNIX_TIMESTAMP(NOW()) where id=?")
@SQLDeleteAll(sql = "update t_gw_it_net_assets_rate_exception set deleted = UNIX_TIMESTAMP(NOW()) where id=?")
@Table(name = "t_gw_it_net_assets_rate_exception", indexes = {@Index(name = "UK_HOST_IF_NAME", columnList = "host, if_name, deleted", unique = true)})
public class RateExceptionExclude extends BaseEntity implements Serializable {

    private static final long serialVersionUID = -2794373844647681775L;

    @Column(name = "host", columnDefinition = "varchar(128) not null comment '主机'")
    private String host;

    @Column(name = "if_name", columnDefinition = "varchar(128) comment '接口名称'")
    private String ifName;

    @Column(name = "reference_speed", columnDefinition = "varchar(128) comment '基准速率'")
    private String referenceSpeed;

    @Column(name = "description", columnDefinition = "varchar(128) comment '描述'")
    private String description;

}
